/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scactbindevi")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scactbindevi.findAll", query = "SELECT s FROM Scactbindevi s"),
    @NamedQuery(name = "Scactbindevi.findByScactbindeviid", query = "SELECT s FROM Scactbindevi s WHERE s.scactbindeviid = :scactbindeviid"),
    @NamedQuery(name = "Scactbindevi.findByPrioridad", query = "SELECT s FROM Scactbindevi s WHERE s.prioridad = :prioridad"),
    @NamedQuery(name = "Scactbindevi.findByReferencia", query = "SELECT s FROM Scactbindevi s WHERE s.referencia = :referencia")})
public class Scactbindevi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scactbindeviid")
    private Integer scactbindeviid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "prioridad")
    private int prioridad;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "referencia")
    private String referencia;
    @JoinColumn(name = "scactbtipeviid", referencedColumnName = "scactbtipeviid")
    @ManyToOne(optional = false)
    private Scactbtipevi scactbtipeviid;
    @JoinColumn(name = "scactbindicaid", referencedColumnName = "scactbindicaid")
    @ManyToOne(optional = false)
    private Scactbindica scactbindicaid;
    @JoinColumn(name = "scactbevidenid", referencedColumnName = "scactbevidenid")
    @ManyToOne(optional = false)
    private Scactbeviden scactbevidenid;

    public Scactbindevi() {
    }

    public Scactbindevi(Integer scactbindeviid) {
        this.scactbindeviid = scactbindeviid;
    }

    public Scactbindevi(Integer scactbindeviid, int prioridad, String referencia) {
        this.scactbindeviid = scactbindeviid;
        this.prioridad = prioridad;
        this.referencia = referencia;
    }

    public Integer getScactbindeviid() {
        return scactbindeviid;
    }

    public void setScactbindeviid(Integer scactbindeviid) {
        this.scactbindeviid = scactbindeviid;
    }

    public int getPrioridad() {
        return prioridad;
    }

    public void setPrioridad(int prioridad) {
        this.prioridad = prioridad;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public Scactbtipevi getScactbtipeviid() {
        return scactbtipeviid;
    }

    public void setScactbtipeviid(Scactbtipevi scactbtipeviid) {
        this.scactbtipeviid = scactbtipeviid;
    }

    public Scactbindica getScactbindicaid() {
        return scactbindicaid;
    }

    public void setScactbindicaid(Scactbindica scactbindicaid) {
        this.scactbindicaid = scactbindicaid;
    }

    public Scactbeviden getScactbevidenid() {
        return scactbevidenid;
    }

    public void setScactbevidenid(Scactbeviden scactbevidenid) {
        this.scactbevidenid = scactbevidenid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scactbindeviid != null ? scactbindeviid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scactbindevi)) {
            return false;
        }
        Scactbindevi other = (Scactbindevi) object;
        if ((this.scactbindeviid == null && other.scactbindeviid != null) || (this.scactbindeviid != null && !this.scactbindeviid.equals(other.scactbindeviid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scactbindevi[ scactbindeviid=" + scactbindeviid + " ]";
    }
    
}
